package models;

import javax.persistence.Entity;
import java.util.*;
import javax.persistence.*;
import java.util.ArrayList;

import play.db.jpa.*;

@Entity
public class Notification extends Model {
	/**
	 * its the content of the notification that appears to user .
	 * 
	 * @author youstina galal
	 */
	public String content;
	/**
	 * the user who initiate an action that causes a notification to be
	 * sent
	 * 
	 * @author youstina galal
	 */
	@ManyToOne
	public User user;
	/**
	 * the time at which this notification has been sent
	 * 
	 * @author youstina galal
	 */

	public Date time;

	/**
	 * type is either Topic or comment or idea
	 * 
	 * @author youstina galal
	 */
	public String type;
	/**
	 * this is the type id
	 * 
	 * @author youstina galal
	 */
	public Long typeId;

	

	/**
	 * creates a new notification
	 * 
	 * 
	 * @param Content
	 *            the new Notification's body
	 * @param User
	 *            the user that initiate this notification .
	 * @param type
	 *            its the reason for initiating the notification, is it
	 *            topic,comment,idea.,written as ex: "Topic"
	 * @param id
	 *            its the id of the type
	 * @author youstina galal
	 * @author Shahir El Faramawy
	 */
	public Notification(String content, User user, String type, Long id) {
		this.content = content;
		this.user = user;
		time = new Date();
		this.type = type;
		this.typeId = id;
	}

}
